package com.supervision.manage.controller

import com.fly.base.annotation.AuthPermission
import com.fly.base.common.DataResponse
import com.supervision.manage.service.CommonService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

@Controller
@RestController("CommonController")
@RequestMapping("/manage/1/common")
@Api(tags= ["公共控制器"])
class CommonController {

    @Autowired
    lateinit var commonService: CommonService

    @ApiOperation("短信发送")
    @RequestMapping("/smsSend", method = [(RequestMethod.POST)])
    @AuthPermission(needToken = false)
    fun sendSms(@ApiParam(value = "短信类型 1=登录注册2=手机绑定", name = "type") @RequestParam("type") type: Int,
                @RequestParam("phone") phone: String): DataResponse {
//        commonService.testSmsSend(phone)
        return DataResponse.create()
    }

}
